
<%@ page import="Trabajo.Compra" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'compra.label', default: 'Compra')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
<table>
          <thead>
                  <tr>

                          <g:sortableColumn property="tipo" title="${message(code: 'compra.tipo.label', default: 'Tipo')}" />

                          <g:sortableColumn property="cantidad" title="${message(code: 'compra.cantidad.label', default: 'Cantidad')}" />
                          <g:sortableColumn property="cantidad" title="${message(code: 'compra.precio.label', default: 'Total')}" />
                  </tr>
          </thead>
          <tbody>            
          <g:each in="${compraInstanceList}" status="i" var="compraInstance">
                <tr>
                        <td><g:link action="show" id="${compraInstance.id}">${fieldValue(bean: compraInstance, field: "tipo")}</g:link></td>
                        <td>${fieldValue(bean: compraInstance, field: "cantidad")}</td>
                        <td>${compraInstance.precio}</td>
                </tr>
           </g:each>
          <tbody> 
            </table>
          
          <table>
            <tr><td>Total</td><td>${Total}</td></tr>
            <tr><td>Total Time</td><td>${max}</td></tr>
            
            
          </table>
          <g:form action="pdf">
            <g:hiddenField name="Total" type="number" value="${Total}" required=""/>
            <g:hiddenField name="max" type="number" value="${max}" required=""/>
              Nombre:<g:field name="nombre" type="text" value="${nombre}" required=""/>
              <br>
              Dirección:<g:field name="direccion" type="text" value="${direccion}" required=""/>
              <input type="submit" value="pdf"/>
          </g:form>
              <g:form action="save" >
                <g:actionSubmit class="create" action="create" value="Volver al la Tienda" />
              </g:form>
	</body>
</html>
